/* 
 * File:   editor_dialog.hpp
 * Author: jolo
 *
 * Created on 12. Oktober 2011, 16:02
 */

#ifndef WIDGETS_EDITOR_DIALOG_HPP
#define	WIDGETS_EDITOR_DIALOG_HPP

#include "dialog.hpp"

namespace model {
    class entity;
    typedef shared_ptr<entity> entity_ptr;
}

namespace widgets
{
    class data_editor;
    
    class editor_dialog: public dialog
    {
        Q_OBJECT
    public:
        editor_dialog(model::entity_ptr e, QWidget* p);
        virtual ~editor_dialog();
        
        data_editor* editor() {
            return editor_;
        }
        
        model::entity_ptr entity() const {
            return e_;
        }
        
    protected:
        virtual data_editor* create_editor() = 0;
        virtual void set_editor(data_editor* p);
        
    private:
        model::entity_ptr e_;
        data_editor* editor_;
    };
}

#endif	/* EDITOR_DIALOG_HPP */

